package app.fugema.shop.main.center.adapter;

import com.base.common.utils.DensityUtil;
import com.base.common.utils.UIUtils;
import com.base.common.view.adapter.ada.BaseRVAdapter;
import com.base.common.view.adapter.connector.BaseItemMultiType;
import com.base.common.view.adapter.connector.BaseViewHolder;

import android.graphics.Paint;
import android.view.View;

import app.fugema.shop.R;
import app.fugema.shop.databinding.ItemGiftGoodsViewBinding;
import app.fugema.shop.main.center.model.GiftOrderBean;

public class GiftDetailItemMultiType extends BaseItemMultiType<GiftOrderBean.ItemsBean, ItemGiftGoodsViewBinding>
{

    @Override
    public int getLayoutId()
    {
        return R.layout.item_gift_goods_view;
    }

    @Override
    public void onBindViewHolder(ItemGiftGoodsViewBinding binding, int position, BaseViewHolder viewHolder, GiftOrderBean.ItemsBean bean)
    {
        super.onBindViewHolder(binding, position, viewHolder, bean);
        if (viewHolder.getAdapter() != null)
        {
            int firstPos = viewHolder.getAdapter().getFirstPosition(BaseItemMultiType.TYPE_CHILD, 0);
        }
        //添加删除线
        binding.tvGiftValue.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
    }

    @Override
    public void onItemClick(View view, BaseRVAdapter adapter, int onclickType, int position, GiftOrderBean.ItemsBean bean)
    {
        super.onItemClick(view, adapter, onclickType, position, bean);
        switch (view.getId())
        {
            case R.id.givGoodsImage:
                //GoodsDetailActivity.start(view.getContext(), bean.getProductId());
                break;

            //case R.id.rtvEvaluate:
                //退款
                //OrderAfterSaleCreateActivity.start(view.getContext(), bean.getOrderNumber(), bean);
                //OrderAfterSaleDetailActivity.start(view.getContext(), bean.getRefundSn());
                // 评价
                //EvaluateAddActivity.start(view.getContext(), bean);
               // break;
        }

    }
}
